//
//  BaseViewController.m
//  bitcoin
//
//  Created by  旺链 on 2018/5/22.
//  Copyright © 2018年 比特币. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor colorWithRed:46/255.0 green:49/255.0 blue:69/255.0 alpha:1];
    //导航栏添加返回按钮
    [self addLeftBtn];
}
- (void)addLeftBtn{
//    //返回按钮
//    self.leftButton = [Factory backButton:self];
    UIButton *btn = [[UIButton alloc] init];
    btn.frame = CGRectMake(0, 0, 80, 64);
//    [btn setImageEdgeInsets:UIEdgeInsetsMake(0, -50, 0, 0)];
    [btn setImage:[UIImage imageNamed:@"arrowleft-icon"] forState:UIControlStateNormal];
    [btn setTitle:@"             " forState:UIControlStateNormal];
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
    [btn addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.leftButton = btn;
//    UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"arrowleft-icon"] style:UIBarButtonItemStylePlain target:self action:@selector(backAction:)];
    self.navigationItem.leftBarButtonItem = backItem;
    
}
- (void)backAction:(id)sender{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
